// import request from '@/utils/request';

import bcrypt from 'bcryptjs';

const hash = '$2a$10$/ZDjum8kGNQMB6jCKjYI3OU.xwmBEYqifJ0MamutIJCNMkm6V.TJ.';

export interface LoginParamsType {
  userName: string;
  password: string;
  mobile: string;
  captcha: string;
  type: string;
}

export async function fakeAccountLogin(params: LoginParamsType) {
  const { userName, password, type } = params;
  if (bcrypt.compareSync(`${userName}_${password}`, hash)) {
    return { status: 'ok', currentAuthority: 'admin', type };
  }
  return {};
  // return request('/api/login/account', { method: 'POST', data: params });
}

export async function getFakeCaptcha(mobile: string) {
  return 'captcha-xxx';
  // return request(`/api/login/captcha?mobile=${mobile}`);
}
